package com.psl.action.work;

import com.psl.services.work.list.spendmoney;
import org.apache.struts2.ServletActionContext;

import javax.servlet.http.HttpServletRequest;

public class moneyAction
{
  public String execute()
  {
    HttpServletRequest request = ServletActionContext.getRequest();
    String name = request.getParameter("name");
    int num = Integer.parseInt(request.getParameter("num"));
    String unit = request.getParameter("unit");
    float money = Float.parseFloat(request.getParameter("money"));
    String date = request.getParameter("date");
    int type = Integer.parseInt(request.getParameter("type"));
    spendmoney sm = new spendmoney();
    sm.insert(name, num, unit, money, type,date);
    sm.moneylistAll();
    return "success";
  }
}
